package com.naiterui.ehp.bp.domain;

import javax.persistence.*;
import java.util.Date;

import static javax.persistence.GenerationType.IDENTITY;

/**
 * OCountry entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "cms_city")
public class City implements java.io.Serializable {

    private static final long serialVersionUID = -626601308864106351L;

    // 全国
    public static final Integer TYPE_ALL = 0;
    // 省
    public static final Integer TYPE_PRO = 1;
    // 市
    public static final Integer TYPE_CITYS = 2;
    // 区
    public static final Integer TYPE_REGI0N = 3;
    private Integer id;
    private String name;
    private Integer type;
    private Integer parentId;
    private Boolean available;
    private String createdBy;
    private Date createdAt;
    private String changedBy;
    private Date changedAt;
    private String fullName;
    private String parentName;
    private Integer municipality = 0;
    // 热门城市 fanjd 2016/09/23 代发货项目
    private Integer hot;

    private Integer weight;


    // Property accessors
    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "id", unique = true, nullable = false)
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @Column(name = "name", length = 20)
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Column(name = "type", length = 20)
    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    @Column(name = "parent_id")
    public Integer getParentId() {
        return parentId;
    }

    public void setParentId(Integer parentId) {
        this.parentId = parentId;
    }

    @Column(columnDefinition = "bit")
    public Boolean getAvailable() {
        return available;
    }

    public void setAvailable(Boolean available) {
        this.available = available;
    }

    @Column(name = "created_by", length = 20)
    public String getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }

    @Column(name = "created_at", length = 19)
    public Date getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    @Column(name = "changed_by", length = 20)
    public String getChangedBy() {
        return changedBy;
    }

    public void setChangedBy(String changedBy) {
        this.changedBy = changedBy;
    }

    @Column(name = "changed_at", length = 19)
    public Date getChangedAt() {
        return changedAt;
    }

    public void setChangedAt(Date changedAt) {
        this.changedAt = changedAt;
    }

    @Column(name = "full_name")
    public String getFullName() {
        return fullName;
    }

    public void setFullName(String fullName) {
        this.fullName = fullName;
    }

    /**
     * @return the municipality
     */
    @Column(name = "municipality", nullable = false)
    public Integer getMunicipality() {
        return municipality;
    }

    /**
     * @param municipality the municipality to set
     */
    public void setMunicipality(Integer municipality) {
        this.municipality = municipality;
    }

    /**
     * @return String 取得域 parentName 的方法。
     */
    @Column(name = "parent_name")
    public String getParentName() {
        return parentName;
    }

    /**
     * @param parentName 对域 parentName 的设置方法.
     */
    public void setParentName(String parentName) {
        this.parentName = parentName;
    }

    @Column(name = "hot")
    public Integer getHot() {
        return hot;
    }

    public void setHot(Integer hot) {
        this.hot = hot;
    }

    @Column(name = "weight")
    public Integer getWeight() {
        return weight;
    }

    public void setWeight(Integer weight) {
        this.weight = weight;
    }

    @Override
    public String toString() {
        StringBuffer sb = new StringBuffer("City{");
        sb.append("id=").append(id);
        sb.append(", name='").append(name).append('\'');
        sb.append(", type=").append(type);
        sb.append(", parentId=").append(parentId);
        sb.append(", available=").append(available);
        sb.append(", createdBy='").append(createdBy).append('\'');
        sb.append(", createdAt=").append(createdAt);
        sb.append(", changedBy='").append(changedBy).append('\'');
        sb.append(", changedAt=").append(changedAt);
        sb.append(", fullName='").append(fullName).append('\'');
        sb.append(", parentName='").append(parentName).append('\'');
        sb.append(", municipality=").append(municipality);
        sb.append(", hot=").append(hot);
        sb.append('}');
        return sb.toString();
    }
}